Jonas Dreßler [Tue, 18 Feb 2020 14:05:57 +0000 (15:05 +0100)]
keyboard: Plug a leak of KeyboardControllers
To make sure the GC really disposes the KeyboardController object we
need to remove all references to the object, which means we have to
disconnect signals the object connects to, too.
This also fixes a bug where keys remain pressed forever and thus also
break that key on real keyboards. It happens if the OSK gets destroyed
during an OSK-key is being held so the StButton of the key is not
released. That means the key remains pressed in the
MetaVirtualInputDevice that we are now leaking because
KeyboardController isn't garbage collected.
Florian Müllner [Fri, 14 Feb 2020 15:10:34 +0000 (16:10 +0100)]
js: Don't use templates in files with translations
xgettext gained some support for template strings, and no longer
fails when encountering '/' somewhere between backticks.
Unfortunately its support is still buggy as hell, and it is now
silently dropping translatable strings, yay. I hate making the
code worse, but until xgettext really gets its shit together,
the only viable way forward seems to be to not use template
strings in any files listed in POTFILES.
Jonas Dreßler [Mon, 17 Feb 2020 18:59:31 +0000 (19:59 +0100)]
dialogs: Use a smaller font-size if the title width exceeds the space
Since quite a few strings of dialogs provided by external programs are
not updated yet and the string freeze is already in effect, make sure we
don't break those dialogs by stripping aways large parts of the
headline.
To do that, detect if the title label is larger than the available width
and if it is, switch to a smaller font-size of 13pt. This makes sure we
still show about the same number of characters in the headline as we did
in previous releases.
Florian Müllner [Fri, 14 Feb 2020 21:26:56 +0000 (22:26 +0100)]
screenShield: Always deactivate when interrupting idle before lock
With the old screen shield, we were simply hiding the lightboxes to show
the shield when the user became active after activating the shield but
before locking the screen (that is, when using a lock-delay).
However now that the shield is gone, we end up showing the unlock dialog
even though we are not actually locked.
We probably don't want to add back a shield-like mode (that is, a way to
raise the unlock dialog without authentication when we aren't locked),
so just deactivate the whole shield when the user becomes active again
before the lock kicks in.
Jonas Dreßler [Fri, 14 Feb 2020 21:11:27 +0000 (22:11 +0100)]
Update hint texts of all entries
The design team discussed the ellipses at the end of the hint text of
our entries and, even though they are present in most mockups, it turned
out they don't like them, so remove them.
It also turned out they don't like the prefixes like "Enter" before it,
so remove those, too.
Jonas Dreßler [Tue, 4 Feb 2020 18:24:43 +0000 (19:24 +0100)]
networkAgent: Update dialog entry descriptions for new design
With the new dialog design the descriptions of entries are now
implemented as hint-text of the StEntry. That means the colon at the end
of the descriptions no longer makes sense and should be removed.
Florian Müllner [Fri, 14 Feb 2020 19:19:37 +0000 (20:19 +0100)]
unlock: Don't show prompt on shifty key presses
Shift, caps-lock and friends change the capitalization of following
key presses. It is unexpected for those keys to have side-effects,
so don't switch to the prompt when they are pressed.
Florian Müllner [Fri, 14 Feb 2020 20:10:04 +0000 (21:10 +0100)]
authPrompt: Use placeholder label to avoid layout changes
We don't want to show a caps-lock warning when showing a non-password
entry, but we also don't want the layout to jump when changing the
label's visibility.
Achieve that by inserting an empty placeholder label that we can
show whenever the caps-lock warning is hidden.
Florian Müllner [Fri, 14 Feb 2020 19:50:59 +0000 (20:50 +0100)]
Revert "authPrompt: Don't hide the caps lock warning label"
Using the opacity to control the label's visibility doesn't work
correctly, as CapsLockWarning itself changes the opacity when
the caps-lock state changes.
Right now, it's still a label displayed following the same
layout algorithm of the cog button in the login screen. It'll
become a button later in the patchset.
Jakub Steiner [Thu, 13 Feb 2020 20:13:49 +0000 (21:13 +0100)]
theme: Lock screen notification style tweaks
- use standard border radius for notifications
- negative space pills for counters
- no border, slightly less opaque background allowed
by the massive blur radius for the wallpaper
Usually, logging in or unlocking the session is made asynchronously,
and AuthPrompt properly manages which entry is currently visible.
External code don't rely on any specific entry to be set, since it
is AuthPrompt's responsibility to select the correct one to be shown.
However, there's one specific case where AuthPrompt must preserve
the password entry: on reset. The reset code preserved whatever
entry was currently displayed, but after fe69dacaf1, it always
changes to the username entry.
loginDialog: Hide session menu button when showing the user list
In the past, the session menu button was part of the auth prompt widgetry,
so we didn't have to manually hide it when showing the user list. However,
now it is part of the login screen itself.
Hide the session menu button when the user list is shown.
Florian Müllner [Thu, 13 Feb 2020 18:06:51 +0000 (19:06 +0100)]
unlockDialog: Only show count for multiple notifications
In the common case where we only have a single unread notification
from a particular app, the count doesn't add useful information.
Reduce clutter a bit by only showing the notification count if we
have at least two.
Florian Müllner [Tue, 11 Feb 2020 18:35:22 +0000 (19:35 +0100)]
unlockDialog: Show unlock hint on inactivity
Inactivity on the unlock screen can be an indication that the user
doesn't know how to get to the auth prompt. Fade in a small hint
that points them in the right direction.
Florian Müllner [Tue, 11 Feb 2020 16:46:11 +0000 (17:46 +0100)]
unlockDialog: Support clock/prompt switching via scrolling
SwipeTracker "only" handles touch gestures and smooth scrolling.
Scrolling still makes sense for regular mice as well though, so
add handling for that as well.
Florian Müllner [Sun, 2 Feb 2020 11:23:32 +0000 (12:23 +0100)]
unlockDialog: Add swipe gesture
Clicking or typing to reveal the auth prompt are good options for
mouse/keyboard workflows, but awkward on touch devices. Now that
we have SwipeTracker, adding corresponding gestures support is
easy, so do just that.
authPrompt: Don't hide the caps lock warning label
Hiding the Caps lock warning label changes the layout of
Auth Prompt. This is specially noticeable when logging in
with unlisted users, where we change the visibility of this
label after typing a username, and the whole user widget
moves a bit.
Change the Cap lock label's opacity instead of hiding it.
Currently, AuthPrompt is connecting to its own 'next' signal
signal to react to any of the entries being activated, and do
some actions like starting the spinner and answering the PAM
question.
Refactor this code into another method, and don't connect to
our own signal.
Unfortunately, the question that is displayed comes directly
from PAM. It usually is just "Password:", which comes from
pam-unix, but other questions can be set, usually with the
colons, since they are crafted with a CLI workflow in mind.
Manually drop the colons from questions asked by PAM. This
is also done by the PolKit agent, which shows how the stack
is fragile, but it's what we have for now.
authPrompt: Connect signals to both text and password entries
This is a regression from the transition to password entry. Both
entries need to be connected to the relevant signals, otherwise
username-based login won't ever work.
Currently, there is a dedicated label above the entry to
display the question text. According to the new mockups
for the lock screen, this label doesn't exist; instead,
the question is set inside the entry itself, as a hint
text.
Set the questions as hint texts of the entry, and remove
the now unused label.
Umang Jain [Fri, 17 Jan 2020 06:47:34 +0000 (12:17 +0530)]
userWidget: Adapt if user is not mentioned for username login
If username-based login flow is followed, we need a default avatar
for the userWidget. Hence, check if the user passed to userWidget
is (null) which implies a username-based login flow.
Umang Jain [Tue, 14 Jan 2020 18:27:02 +0000 (23:57 +0530)]
theme: Add top padding to unlock-dialog-clock-time
The (imaginary) center line for clock time of unlock dialog and the
user avatar should be the same. Since the clock font is 64pt, we need
32pt padding (or 42px).
Umang Jain [Tue, 14 Jan 2020 14:53:36 +0000 (20:23 +0530)]
userWidget: Allow vertical orientation for user avatars
Allow vertical orientation for the userWidget so that the user-avatar
can be centered and user's name can be placed below it. The plan
for 3.36 is to use this vertical userWidget layout for both lock
and login screen.
The userWidget is also used while creating the user-selection list
at the login, hence we still need to keep the horizontal layout
for userWidget in place.
Florian Müllner [Wed, 12 Feb 2020 18:46:44 +0000 (19:46 +0100)]
theme: Make base icon size font-relative
Most icons are used along-side text, like the top bar or menus.
It therefore makes sense for them to adjust along-side the text
when the text-scaling changes.
Jonas Dreßler [Tue, 11 Feb 2020 19:19:50 +0000 (20:19 +0100)]
unlockDialog: Multiply blur sigma value with the scale factor
Since the blur sigma decides how many pixels get factored in when
blurring and setting a scale factor increases the background texture by
that factor, the sigma value should also be multiplied by the scale
factor.
If we modify the paint volume to make it larger and include the blur
radius, we should also use the gained size and draw something there.
Since the framebuffers are only the size of the actor to blur, we're not
doing that right now anyway, so remove the vfunc override.
Jonas Dreßler [Mon, 10 Feb 2020 14:34:57 +0000 (15:34 +0100)]
blur-effect: Use sigma value instead of blur radius
Almost all implementations, including CSS [1] of gaussian blurs use the
sigma/standard deviation value as the input parameter, even if they call
that value "radius". Since using sigma is more correct mathematically
and avoids confusion for people used to other blur implementations, use
that parameter here, too.
Jonas Dreßler [Mon, 10 Feb 2020 14:34:03 +0000 (15:34 +0100)]
blur-effect: Implement incremental calculation of gauss coefficient
Use the shader for linear sampling and incremental calculation of the
gaussian kernel values as it was implemented by Patrick Walton in
webrender.
The sigma value for the blur (the standard deviation) is calculated by
taking the blur radius and dividing it by 3, this value is used by most
implementations of gaussian blurs since it covers a high percentage of
the gaussian shape.
The linear sampling optimization is implemented by skipping every second
texel (i += 2) in the for-loop that's sampling adjacent texels.